package com.example.common;

import org.springframework.http.HttpStatus;

/**对服务响应信息枚举类
 *
 * @email: pengyujun53@163.com
 * @author: peng_YuJun
 * @date: 2022/9/18
 * @time: 9:47
 */
public enum HttpStatusEnum {
    ERROR("error",HttpStatus.INTERNAL_SERVER_ERROR.value()),

    SUCCESS("success",HttpStatus.OK.value()),

    NOT_FOUND("404_NOT_FOUND",HttpStatus.NOT_FOUND.value()),

    HEART_BEAT_OK("heartBeatOk",666),

    DATA_NOT_EXIST("未查询到记录！",HttpStatus.NO_CONTENT.value()),

    USER_NOT_EXIST("请求用户不存在！",HttpStatus.UNAUTHORIZED.value()),

    LOGIN_EXPIRED("登录已过期！",HttpStatus.UNAUTHORIZED.value()),

    NO_PERMISSION_ERROR("无权限访问！",HttpStatus.REQUESTED_RANGE_NOT_SATISFIABLE.value()),

    BAD_REQUEST("请求参数异常！",HttpStatus.BAD_REQUEST.value());

    private String message;
    private int code;

    HttpStatusEnum(String message, int code) {
        this.message = message;
        this.code = code;
    }

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }

    public int getCode() {
        return code;
    }

    public void setCode(int code) {
        this.code = code;
    }
}
